{messages}
{if !$aPost.content}
<form method="post" action="{url link='admin.language.phrases'}">
<table style="width:100%;" class="forumline" cellspacing="0" cellpadding="0">
<tr>
    <td class="row-header" colspan="2">
    <span>
	{language text='language_search'}
    </span>
    </td>
</tr>
<tr>
	<td class="row1" style="text-align:right;">
		{language text='search_for_text'}:
	</td>
	<td class="row1">
		<input type="text" name="q" value="{$aPost.q|escape}" size="40" />
	</td>
</tr>
<tr>
	<td class="row1" style="text-align:right;">
		{language text='search_in_language'}:
	</td>
	<td class="row1">
		<select name="id">
		<option value="">{language text='all_languages'}</option>
		<optgroup label="{language text='translation'}">
		{foreach from=$aLanguages item=aLanguage}
			<option value="{$aLanguage.id}"{if $aPost.id == $aLanguage.id} selected="selected="{/if}>{$aLanguage.title}</option>
		{/foreach}
		</optgroup>
		</select>
	</td>
</tr>
<tr>
	<td class="row1" style="text-align:right; vertical-align:top;">
		{language text='search_in_module'}:
	</td>
	<td class="row1">
		<select name="module">
		<option value="">{language text='select'}</option>
		{foreach from=$aModules item=aModule}
		<option value="{$aModule|replace:'_':'-'}"{if $aPost.module|replace:'-':'_' == $aModule} selected="selected="{/if}>{$aModule}</option>
		{/foreach}
		</select>
	</td>
</tr>
<tr>
	<td class="row1" style="text-align:right; vertical-align:top;">
		{language text='search_in'}:
	</td>
	<td class="row1">
		<label><input type="radio" name="type" value="text"{if $aPost.type == 'text'} checked="checked"{/if}/> {language text='phrase_text_only'}</label> <br />
		<label><input type="radio" name="type" value="varname"{if $aPost.type == 'varname'} checked="checked"{/if}/> {language text='phrase_variable_name_only'}</label> <br />
		<label><input type="radio" name="type" value="both"{if $aPost.type == 'both'} checked="checked"{/if}/> {language text='both_variable_name'}</label> <br />
	</td>
</tr>
<tr>
	<td class="catBottom" colspan="5" style="text-align:center;">
		<input type="submit" name="search" value="{language text='search'}" />
		<input type="button" value="{language text='reset'}" onclick="window.location.href='{url link='admin.language.phrases'}';" />
	</td>
</tr>
</table>
</form>
<br />
{/if}

<form method="post" action="{url link='current'}">
<table style="width:100%;" class="forumline" cellspacing="0" cellpadding="0">
<tr>
    <td class="row-header" colspan="5">
    <span>
    {language text='language_edit'}
    </span>
    </td>
</tr>
{if count($aItems) > 0}
<tr>
	<td class="row1" colspan="5">
	<table style="width:100%;" cellpadding="0" cellspacing="0">
	<tr>
		<td>{language text='global_pager' count1=$iFrom count2=$iTo count3=$iCnt}</td>
    	<td style="text-align:right;">{include file="_blocks/pager.html"}</td>
    </tr>
    </table>
    </td>
</tr>
<tr>
	<th></th>
    <th>{language text='language_varname'}</th>
    {if !$iId}
    <th>{language text='language'}</th>
    {/if}
    {if !$aPost.content}
    <th>{language text='language_original'}</th>
    {/if}
    <th>{language text='language_text'}</th>
</tr>
{foreach from=$aItems item=aItem}
<tr>
	<td class="row1" style="vertical-align:top; width:10px; text-align:center;">
		<input type="checkbox" name="deleteid[]" value="{$aItem.phraseid}" />
	</td>
	<td class="row1" style="vertical-align:top;">
		{$aItem.varname}
	</td>
	{if !$iId}
	<td class="row1" style="vertical-align:top;">
		{$aItem.title}
	</td>
	{/if}
	{if !$aPost.content}
	<td class="row1" style="vertical-align:top;">
		{$aItem.default|escape}
	</td>
	{/if}
	<td class="row1" style="vertical-align:top; text-align:center;">
		<textarea cols="60" rows="6" name="text[{$aItem.phraseid}]">{$aItem.text|escape}</textarea>
	</td>
</tr>
{/foreach}
<tr>
	<td class="catBottom" colspan="5" style="text-align:center;">
		&nbsp;&nbsp;<input type="submit" name="save" value="{language text='save'}" />
		&nbsp;&nbsp;<input type="button" value="{language text='Mod_Language.add_new_phrase'}" onclick="window.location.href='{url link='admin.language.add-phrase' id=$iId}';" />
		&nbsp;&nbsp;<input type="submit" name="delete" value="{language text='Mod_Language.delete_selected'}" />		
		&nbsp;&nbsp;<input type="submit" name="revert-selected" value="{language text='Mod_Language.revert_selected_to_default'}" />
	</td>
</tr>
<tr>
	<td class="row1" colspan="5">
	<table style="width:100%;" cellpadding="0" cellspacing="0">
	<tr>
		<td>{language text='global_pager' count1=$iFrom count2=$iTo count3=$iCnt}</td>
    	<td style="text-align:right;">{include file="_blocks/pager.html"}</td>
    </tr>
    </table>
    </td>
</tr>
{/if}
</table>
</form>